import socket

ip_port = ('127.0.0.1', 9000)
BUFSIZE = 1024
udp_server = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

udp_server.bind(ip_port)

while True:
    msg, addr = udp_server.recvfrom(BUFSIZE)
    print(msg, addr)

    udp_server.sendto(msg.upper(), addr)
